package com.my.lucky7.dao;

import com.my.lucky7.entity.GalleryImage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface GalleryImageRepository extends JpaRepository<GalleryImage, Integer> {
    List<GalleryImage> findByCategory(String category);
    List<GalleryImage> findByCategoriesContaining(String category);

    @Query(value = "select * from gallery_images where description=:description AND is_delete = 0 ",nativeQuery = true)
    public List<GalleryImage> findByDesc(@Param("description")String desc);
}